package com.sylli.oeuf.server.game.logic;

import com.sylli.oeuf.server.game.logic.Clazz.ClazzId;
import com.sylli.oeuf.server.object.transferable.LevelUpTO;
import com.sylli.oeuf.server.object.transferable.StatTO;


public class LevelLogic implements Leveling {

	@Override
	public int getMaxExpForLevel(int level) {
		return (level * 100);
	}
	
	@Override
	public LevelUpTO getRewardForGainLevel(int level) {
		LevelUpTO levelup = new LevelUpTO();
		if (level % 2 == 0) {
			levelup.setSkillPoint(2);
			levelup.setStatPoint(4);
		} else {
			levelup.setSkillPoint(0);
			levelup.setStatPoint(8);
		}
		return levelup;
	}

	@Override
	public int getMaxDmgFromStat(StatTO stat, ClazzId clazzId) {
		switch (clazzId) {
		case Vampire:
			return (int) (stat.getStatStr() * 1.1);
		case Exorcist:
			return (int) (stat.getStatInt() * 1.3);
		default:
			return (int) (stat.getStatStr() * 1.3);
		}
	}

	@Override
	public int getMinDmgFromStat(StatTO stat, ClazzId clazzId) {
		switch (clazzId) {
		case Vampire:
			return (int) (stat.getStatStr() * 0.8); 
		case Exorcist:
			return (int) (stat.getStatInt() * 1.0);
		default:
			return (stat.getStatStr());
		}
	}
	
	@Override
	public int getMaxHpFromStat(StatTO stat, ClazzId clazzId) {
		switch (clazzId) {
		case Vampire:
			return (int) (stat.getStatCon() * 10) + 100; 
		case Exorcist:
			return (int) (stat.getStatCon() * 8) + 80;
		}
		return 0;
	}

	@Override
	public int getMaxMpFromStat(StatTO stat, ClazzId clazzId) {
		switch (clazzId) {
		case Vampire:
			return (int) (stat.getStatWis() * 8); 
		case Exorcist:
			return (int) (stat.getStatWis() * 12) + 10;
		}
		return 0;
	}

}
